package com.etouch.security.controller;

import com.etouch.security.propertie.SecurityProperties;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.RolesAllowed;

/**
 * @author chenyunchang
 * @title
 * @date 2020/11/10 14:09
 * @Description:
 */
@RequestMapping("/test")
@RestController
@Api(tags = "测试类")
public class TestController {

    @GetMapping("/generatePassword")
    @ApiOperation("生成security加密的密码")
    public String SecurityEncodePwd(String password) {
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
        return bCryptPasswordEncoder.encode(password);
    }


}
